#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include<iostream> 
using namespace std;
typedef struct node{
   int data;
   struct node *next;
}ListNode;
typedef ListNode *List;
void CreateList(List &L,int n);
void ReverseList(List &L);
void PrintList(List L);

int main()
{
       int n;
      List L;
      cin>>n;
     CreateList(L,n);
    ReverseList(L);
    PrintList(L);

 } 
 void CreateList(List &L,int n)
 {
 	int i;
 	int x;
 	L=new ListNode;
	L->next=NULL;
	List p,r;
	r=L;
	for(i=0;i<n;i++)
	{
		p=new ListNode;
		cin>>x;
		p->data=x;
		r->next=p;
		r=p;
	}
	r->next=NULL;
 } 
 void ReverseList(List &L)
 {
 	List p=L->next,s,q; 
 	if(p==NULL||L==NULL)
	 ; 
 	s=new ListNode;
 	s->next=NULL;
 	while(p)
 	{
 		q=new ListNode;
 		q->data=p->data;
 		q->next=s->next;
 		s->next=q;
 		p=p->next;
	 }
	 L=s;
 } 
 void PrintList(List L)
 {
 	List p=L->next;
 	if(p==NULL||L==NULL)
 	cout<<"NULL"; 
 	while(p){
 		cout<<p->data;
 		if(p->next!=NULL)
 		cout<<" ";
 		p=p->next;
	 }
 	
 }
  
